#ifndef __IMU_H
#define __IMU_H

//#ifdef __cplusplus
//extern "C" {
//#endif
	
#include "headfile.h"

// ÉÏº£ÖØÁ¦¼ÓËÙ¶È9.7963
//#define Gg 9.7963
#define WIT_DATA_SUM          11    //WITÊý¾Ý×Ü³¤
#define WIT_HEADER            0x55  //WITÖ¡Í·
//#define WIT_ACC_HEADER        0x51	//WIT¼ÓËÙ¶ÈÖ¡Í
#define WIT_GYRO_HEADER       0x52
#define WIT_ANGLE_HEADER      0x53	//WIT½Ç¶ÈÖ¡Í·
//#define WIT_Quaternion_HEADER 0x59	//WITËÄÔªÊýÖ¡Í·

//typedef enum
//{
////	WIT_ACC,
//	WIT_ANGLE,
//	WIT_GYRO,
////	WIT_Quaternion,
//	WIT_DATA_NUM,
//}WIT_DATA_e;

//typedef struct 
//{
//	short data[3];
//}WIT_Angle_t;

//typedef struct 
//{
//	short data[3];
//}WIT_ACC_t;

//typedef struct 
//{
//	short data[3];
//}WIT_GYRO_t;

//typedef struct
//{
//	short data[4];
//}WIT_Quaternion_t;


///*¹³×Óº¯Êý*/
//typedef struct
//{
//	void (*imu_hook)(uint32_t *imu);
//}hook_t;

//typedef struct
//{
//	double pitch;
//	double roll;
//	double yaw;
//	int yaw_int;
//	
//	double GYRO_X;
//	double GYRO_Y;
//	double GYRO_Z;

//	double ACC_x;
//	double ACC_y;
//	double ACC_z;
//		
//	double q0,q1,q2,q3;
//}__attribute__((packed)) IMU_data_t;


//typedef struct 
//{

//	IMU_data_t data;

//	WIT_Angle_t Angle;
//	WIT_ACC_t ACC;
//	WIT_GYRO_t GYRO;
//	WIT_Quaternion_t Quaternion;
//	
//	WIT_DATA_e hook_signal;

//	/*»Øµ÷Êý×é*/
//	hook_t hook_fun[WIT_DATA_NUM];
//	
//	unsigned char temp[WIT_DATA_NUM][11];
//	
//	unsigned char rx_buffer[255];
//	unsigned char rx_origin_data;
//		
//}IMU931_t;

struct Angle
{
	short Angle[3];
	short T;
};


//extern IMU931_t IMU931;


//void IMU_Init(IMU931_t *imu);
//void IMU_uart_callback(IMU931_t *imu);
//void IMU_hook(IMU931_t *imu);
//IMU_data_t * Get_IMU_Data(IMU931_t *imu);
void imu_yaw_analysis();
void imu_gyro_analysis();
void IMU_uart_callback();

extern double yaw_angle;
extern double z_gyro;
extern uint8_t imu_gyro_flag;
extern uint8_t imu_angle_flag;
extern uint8_t origin_data;
extern int yaw_angle_int;  



//#ifdef __cplusplus
//}
//#endif

#endif